﻿Jxstar.currentPage = function() {
	var config = {param:{},initpage:function(page, define){},eventcfg:{}};

	var auditData = Jxstar.findComboData('audit');
	var paystatusData = Jxstar.findComboData('paystatus');
	var authtypeData = Jxstar.findComboData('authtype');

	var cols = [
	{col:{header:'记录状态', width:73, sortable:true, hidden:true, align:'center',
		renderer:function(value){
			for (var i = 0; i < auditData.length; i++) {
				if (auditData[i][0] == value)
					return auditData[i][1];
			}
		}}, field:{name:'contract_pay__audit_up',type:'string'}},
	{col:{header:'计划月份', width:90, sortable:true, renderer:function(value) {
			return value ? value.format('Y-m') : '';
		}}, field:{name:'contract_pay__plan_month',type:'date'}},
	{col:{header:'合同编号', width:100, sortable:true}, field:{name:'contract_pay__contract_code',type:'string'}},
	{col:{header:'合同名称', width:211, sortable:true}, field:{name:'contract_pay__contract_name',type:'string'}},
	{col:{header:'实际支付(万元)', width:108, sortable:true, renderer:JxUtil.formatNumber(6)}, field:{name:'contract_pay__pay_money1',type:'float'}},
	{col:{header:'支付说明', width:191, sortable:true}, field:{name:'contract_pay__pay_memo',type:'string'}},
	{col:{header:'本月计划付款(万元)', width:126, sortable:true, renderer:JxUtil.formatNumber(6)}, field:{name:'contract_pay__plan_money',type:'float'}},
	{col:{header:'公司核准付款(万元)', width:128, sortable:true, renderer:JxUtil.formatNumber(6)}, field:{name:'contract_pay__check_money',type:'float'}},
	{col:{header:'合同金额(万元)', width:119, sortable:true, renderer:JxUtil.formatNumber(6)}, field:{name:'contract_pay__contract_money',type:'float'}},
	{col:{header:'已付款金额(万元)', width:117, sortable:true, renderer:JxUtil.formatNumber(6)}, field:{name:'contract_pay__pay_money',type:'float'}},
	{col:{header:'收款单位', width:142, sortable:true}, field:{name:'contract_pay__provider_name',type:'string'}},
	{col:{header:'账面欠款(万元)', width:100, sortable:true, renderer:JxUtil.formatNumber(6)}, field:{name:'contract_pay__last_money',type:'float'}},
	{col:{header:'付款依据', width:193, sortable:true}, field:{name:'contract_pay__pay_cause',type:'string'}},
	{col:{header:'付款进度%', width:100, sortable:true, renderer:JxUtil.formatNumber(2)}, field:{name:'contract_pay__pay_ratio',type:'float'}},
	{col:{header:'付款计划状态', width:100, sortable:true, align:'center',
		editable:false,
		editor:new Ext.form.ComboBox({
			store: new Ext.data.SimpleStore({
				fields:['value','text'],
				data: paystatusData
			}),
			emptyText: jx.star.select,
			mode: 'local',
			triggerAction: 'all',
			valueField: 'value',
			displayField: 'text',
			editable:false,
			value: paystatusData[0][0]
		}),
		renderer:function(value){
			for (var i = 0; i < paystatusData.length; i++) {
				if (paystatusData[i][0] == value)
					return paystatusData[i][1];
			}
		}}, field:{name:'contract_pay__plan_status',type:'string'}},
	{col:{header:'项目编码', width:100, sortable:true}, field:{name:'contract_pay__project_code',type:'string'}},
	{col:{header:'项目名称', width:198, sortable:true}, field:{name:'contract_pay__project_name',type:'string'}},
	{col:{header:'项目负责人', width:100, sortable:true}, field:{name:'contract_pay__project_user',type:'string'}},
	{col:{header:'授权方式', width:100, sortable:true, align:'center',
		editable:false,
		editor:new Ext.form.ComboBox({
			store: new Ext.data.SimpleStore({
				fields:['value','text'],
				data: authtypeData
			}),
			emptyText: jx.star.select,
			mode: 'local',
			triggerAction: 'all',
			valueField: 'value',
			displayField: 'text',
			editable:false,
			value: authtypeData[0][0]
		}),
		renderer:function(value){
			for (var i = 0; i < authtypeData.length; i++) {
				if (authtypeData[i][0] == value)
					return authtypeData[i][1];
			}
		}}, field:{name:'contract_pay__auth_type',type:'string'}},
	{col:{header:'立项批复金额(万元)', width:133, sortable:true, renderer:JxUtil.formatNumber(6)}, field:{name:'contract_pay__project_money',type:'float'}},
	{col:{header:'实施单位', width:138, sortable:true}, field:{name:'contract_pay__dept_name',type:'string'}},
	{col:{header:'申请单号', width:100, sortable:true}, field:{name:'contract_pay__pay_code',type:'string'}},
	{col:{header:'申请人ID', width:100, sortable:true, hidden:true}, field:{name:'contract_pay__apply_userid',type:'string'}},
	{col:{header:'合同ID', width:100, sortable:true, hidden:true}, field:{name:'contract_pay__contract_id',type:'string'}},
	{col:{header:'实施单位ID', width:100, sortable:true, hidden:true}, field:{name:'contract_pay__dept_id',type:'string'}},
	{col:{header:'项目负责人ID', width:100, sortable:true, hidden:true}, field:{name:'contract_pay__project_userid',type:'string'}},
	{col:{header:'收款单位ID', width:100, sortable:true, hidden:true}, field:{name:'contract_pay__provider_id',type:'string'}},
	{col:{header:'主键', width:100, sortable:true, hidden:true}, field:{name:'contract_pay__pay_id',type:'string'}},
	{col:{header:'项目ID', width:100, sortable:true, hidden:true}, field:{name:'contract_pay__project_id',type:'string'}},
	{col:{header:'支付确认日期', width:100, sortable:true, renderer:function(value) {
			return value ? value.format('Y-m-d') : '';
		}}, field:{name:'contract_pay__pay_date',type:'date'}},
	{col:{header:'支付确认人', width:100, sortable:true}, field:{name:'contract_pay__pay_user',type:'string'}},
	{col:{header:'月度计划ID', width:100, sortable:true, hidden:true}, field:{name:'contract_pay__mpay_id',type:'string'}}
	];
	
	config.param = {
		cols: cols,
		sorts: null,
		hasQuery: '1',
		isedit: '0',
		isshow: '0',
		funid: 'pay_appsub'
	};
	
	
		
	return new Jxstar.GridNode(config);
}